package com.micro.dto;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

import com.micro.entity.HotelOrder;

// 酒店订单展示 DTO
public class HotelOrderDTO {
    private Long orderId;
    private Long userId;
    private Long hotelId;
    private String hotelName; // 添加酒店名称用于显示
    private LocalDate checkInDate;
    private LocalDate checkOutDate;
    private String orderStatus;
    private BigDecimal paymentAmount;
    private String paymentMethod;
    private LocalDateTime paymentTime;
    private LocalDateTime updateTime;

    public HotelOrderDTO() {}

    // 从 HotelOrder 实体转换的构造方法
    public HotelOrderDTO(HotelOrder order) {
        this.orderId = order.getOrderId();
        this.userId = order.getUserId();
        this.hotelId = order.getHotelId();
        // hotelName 需要在服务层设置
        this.checkInDate = order.getCheckInDate();
        this.checkOutDate = order.getCheckOutDate();
        this.orderStatus = order.getOrderStatus() != null ? order.getOrderStatus().name() : null; // 将枚举转换为字符串，处理null情况
        this.paymentAmount = order.getPaymentAmount();
        this.paymentMethod = order.getPaymentMethod();
        this.paymentTime = order.getPaymentTime();
        this.updateTime = order.getUpdateTime();
    }

    // Getters and Setters
    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getHotelId() {
        return hotelId;
    }

    public void setHotelId(Long hotelId) {
        this.hotelId = hotelId;
    }

    public String getHotelName() {
        return hotelName;
    }

    public void setHotelName(String hotelName) {
        this.hotelName = hotelName;
    }

    public LocalDate getCheckInDate() {
        return checkInDate;
    }

    public void setCheckInDate(LocalDate checkInDate) {
        this.checkInDate = checkInDate;
    }

    public LocalDate getCheckOutDate() {
        return checkOutDate;
    }

    public void setCheckOutDate(LocalDate checkOutDate) {
        this.checkOutDate = checkOutDate;
    }

    public String getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(String orderStatus) {
        this.orderStatus = orderStatus;
    }

    public BigDecimal getPaymentAmount() {
        return paymentAmount;
    }

    public void setPaymentAmount(BigDecimal paymentAmount) {
        this.paymentAmount = paymentAmount;
    }

    public String getPaymentMethod() {
        return paymentMethod;
    }

    public void setPaymentMethod(String paymentMethod) {
        this.paymentMethod = paymentMethod;
    }

    public LocalDateTime getPaymentTime() {
        return paymentTime;
    }

    public void setPaymentTime(LocalDateTime paymentTime) {
        this.paymentTime = paymentTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
}